package cn.zzh.dao;
import cn.zzh.user.User;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;

@Repository
public class UserDaoImp implements UserDao {
    @Resource
    private JdbcTemplate jdbcTemplate;
    @Override
    public List<User> list() {
        String sql="select * from user";
        List<User> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(User.class));
        return query;
    }
}
